class DlgBlack extends PopupPanel {
	constructor() {
		super();
		this.skinName = 'blackSkin';
		fullAlign(this);
	}

	override childrenCreated(): void {
		super.childrenCreated();
	}

	async setTips(
		tips: string,
		end: string,
		times: number,
		delay: number,
		callback?: () => boolean,
	) {
		const lb = new eui.Label();
		// lb.verticalCenter = 0;
		allCenter(lb);
		this.addChild(lb);
		lb.text = tips;
		// lb.x = (this.width - lb.textWidth)/2;
		for (let i = 0; i < times; i++) {
			lb.text += end;
			await waitMs(delay);
			if (callback && callback()) {
				break;
			}
		}
		this.close();
	}
}
